using System;

namespace UnityEngine.Recorder
{
	public class FrameRateHelper
	{
		public static float ToFloat(EFrameRate value, float customValue)
		{
			switch (value)
			{
			case EFrameRate.FR_CUSTOM:
				return customValue;
			case EFrameRate.FR_23:
				return 23.9760246f;
			case EFrameRate.FR_24:
				return 24f;
			case EFrameRate.FR_25:
				return 25f;
			case EFrameRate.FR_29:
				return 29.97003f;
			case EFrameRate.FR_30:
				return 30f;
			case EFrameRate.FR_50:
				return 50f;
			case EFrameRate.FR_59:
				return 59.94006f;
			case EFrameRate.FR_60:
				return 60f;
			default:
				throw new ArgumentOutOfRangeException("value", value, null);
			}
		}

		public static string ToLable(EFrameRate value)
		{
			switch (value)
			{
			case EFrameRate.FR_23:
				return "23.97";
			case EFrameRate.FR_24:
				return "Film (24)";
			case EFrameRate.FR_25:
				return "PAL (25)";
			case EFrameRate.FR_29:
				return "NTSC (29.97)";
			case EFrameRate.FR_30:
				return "30";
			case EFrameRate.FR_50:
				return "50";
			case EFrameRate.FR_59:
				return "59.94";
			case EFrameRate.FR_60:
				return "60";
			default:
				return "(custom)";
			}
		}
	}
}
